<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no, minimal-ui, viewport-fit=cover">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <title>My App</title>
    <link rel="stylesheet" href="../../packages/core/css/framework7.min.css">
    <link rel="stylesheet" href="../../css/framework7-icons.css">
  </head>
  <body>
    <div id="app"></div>
    <template id="app-template">
      <f7-app>
        <f7-view main>
          <f7-page>
            <f7-navbar title="Preloader"></f7-navbar>
      
            <f7-block-title>Default</f7-block-title>
            <f7-block class="row demo-preloaders align-items-stretch text-align-center">
              <f7-col>
                <f7-preloader></f7-preloader>
              </f7-col>
              <f7-col style="background: #000">
                <f7-preloader color="white"></f7-preloader>
              </f7-col>
              <f7-col>
                <f7-preloader :size="42"></f7-preloader>
              </f7-col>
              <f7-col style="background: #000">
                <f7-preloader :size="42" color="white"></f7-preloader>
              </f7-col>
            </f7-block>
      
            <f7-block-title>Color Preloaders</f7-block-title>
            <f7-block class="row text-align-center">
              <f7-col>
                <f7-preloader color="red"></f7-preloader>
              </f7-col>
              <f7-col>
                <f7-preloader color="green"></f7-preloader>
              </f7-col>
              <f7-col>
                <f7-preloader color="orange"></f7-preloader>
              </f7-col>
              <f7-col>
                <f7-preloader color="blue"></f7-preloader>
              </f7-col>
            </f7-block>
      
            <f7-block-title>Multi-color (MD-theme only)</f7-block-title>
            <f7-block class="text-align-center">
              <f7-preloader color="multi"></f7-preloader>
            </f7-block>
      
            <f7-block-title>Preloader Modals</f7-block-title>
            <f7-block>
              <p>With <b>app.preloader.show()</b> you can show small overlay with preloader indicator.</p>
              <p>
                <a class="button button-raised" @click="openIndicator">Open Small Indicator</a>
              </p>
              <p>With <b>app.dialog.preloader()</b> you can show dialog modal with preloader indicator.</p>
              <p>
                <a class="button button-raised" @click="openDialog">Open Dialog Preloader</a>
              </p>
              <p>With <b>app.dialog.preloader('My text...')</b> you can show dialog preloader modal with custom title.</p>
              <p>
                <a class="button button-raised" @click="openCustomDialog">Open Dialog Preloader</a>
              </p>
            </f7-block>
          </f7-page>
        </f7-view>
      </f7-app>
    </template>
    <style>
      .demo-preloaders .col {
        line-height: 42px;
      }
    </style>
    <script>
      var component = {
        methods: {
          openIndicator() {
            const self = this;
            self.$f7.preloader.show();
            setTimeout(() => {
              self.$f7.preloader.hide();
            }, 2000);
          },
          openDialog() {
            const self = this;
            self.$f7.dialog.preloader();
            setTimeout(() => {
              self.$f7.dialog.close();
            }, 2000);
          },
          openCustomDialog() {
            const self = this;
            self.$f7.dialog.preloader('My text...');
            setTimeout(() => {
              self.$f7.dialog.close();
            }, 2000);
          },
        },
      }
    </script>
    <script src="../../packages/vue/vue.min.js"></script>
    <script src="../../packages/vue/framework7-vue.min.js"></script>
    <script src="../../packages/core/js/framework7.min.js"></script>
    <script>
      var theme = 'ios';
      if (location.href.indexOf('theme=md') >= 0) theme = 'md';
      
      if (Framework7.use) Framework7.use(Framework7Vue, { theme: theme });
      else if (Framework7.Class && Framework7.Class.use) Framework7.Class.use(Framework7Vue, { theme: theme });
      
      var plugin = {
        params: {
          theme: theme,
        }
      };
      
      if (Framework7.use) Framework7.use(plugin);
      else if (Framework7.Class && Framework7.Class.use) Framework7.Class.use(plugin);
      
      if (typeof component === 'undefined') {
        var component = {};
      }
      if (typeof routes === 'undefined') {
        var routes = [];
      }
      component.el = '#app';
      component.template = '#app-template';
      
      new Vue(component);
    </script>
  </body>
</html>